Testing a Variable at Runtime Test Variable is an extension to the Idle action that allows you to read the current value of a variable and compare it with a value you specify. This comparison evaluates either as true or false, and the result can be used to trigger two alternative actions. To set up a Test Variable action: 1 Drag the Head Action icon from the Smart tab of the Objects palette into the head section of the page. 2 In the Action Inspector, choose Idle from the Special submenu of the Action menu. 3 In the Condition tab of the Idle action, choose Test Variable from the Variables submenu of the second Action menu. 4 Choose the variable whose value you want to compare from the Variables pop-up menu. 5 The Value item changes automatically with the type of the variable. Use the appropriate control to supply a value (like the URL in the example shown above) you want to test the variable against, as set out in the preceding section on variable initialization. 6 In the Operator pop-up menu, specify the type of the comparison. Note: Not all comparison operators work with all types of variables. For example, using "Greater than" with a string variable will result in a JavaScript error in the browser because the browser expects a number. Using Actions > Using Adobe GoLive actions > Testing a Variable at Runtime |